package com.github.iot.dao.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.github.iot.entity.Button;
import com.github.iot.entity.Door;
import com.github.iot.entity.DoorCommand;
import com.github.iot.entity.Light;
import com.github.iot.entity.NetPattern;
import com.github.iot.entity.NetServer;
import com.github.iot.entity.Showcase;
import com.github.iot.entity.Showroom;
import com.github.iot.entity.SystemSetting;
import com.github.iot.entity.User;
import com.github.iot.entity.UserToken;

import com.github.iot.dao.greendao.ButtonDao;
import com.github.iot.dao.greendao.DoorDao;
import com.github.iot.dao.greendao.DoorCommandDao;
import com.github.iot.dao.greendao.LightDao;
import com.github.iot.dao.greendao.NetPatternDao;
import com.github.iot.dao.greendao.NetServerDao;
import com.github.iot.dao.greendao.ShowcaseDao;
import com.github.iot.dao.greendao.ShowroomDao;
import com.github.iot.dao.greendao.SystemSettingDao;
import com.github.iot.dao.greendao.UserDao;
import com.github.iot.dao.greendao.UserTokenDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig buttonDaoConfig;
    private final DaoConfig doorDaoConfig;
    private final DaoConfig doorCommandDaoConfig;
    private final DaoConfig lightDaoConfig;
    private final DaoConfig netPatternDaoConfig;
    private final DaoConfig netServerDaoConfig;
    private final DaoConfig showcaseDaoConfig;
    private final DaoConfig showroomDaoConfig;
    private final DaoConfig systemSettingDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig userTokenDaoConfig;

    private final ButtonDao buttonDao;
    private final DoorDao doorDao;
    private final DoorCommandDao doorCommandDao;
    private final LightDao lightDao;
    private final NetPatternDao netPatternDao;
    private final NetServerDao netServerDao;
    private final ShowcaseDao showcaseDao;
    private final ShowroomDao showroomDao;
    private final SystemSettingDao systemSettingDao;
    private final UserDao userDao;
    private final UserTokenDao userTokenDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        buttonDaoConfig = daoConfigMap.get(ButtonDao.class).clone();
        buttonDaoConfig.initIdentityScope(type);

        doorDaoConfig = daoConfigMap.get(DoorDao.class).clone();
        doorDaoConfig.initIdentityScope(type);

        doorCommandDaoConfig = daoConfigMap.get(DoorCommandDao.class).clone();
        doorCommandDaoConfig.initIdentityScope(type);

        lightDaoConfig = daoConfigMap.get(LightDao.class).clone();
        lightDaoConfig.initIdentityScope(type);

        netPatternDaoConfig = daoConfigMap.get(NetPatternDao.class).clone();
        netPatternDaoConfig.initIdentityScope(type);

        netServerDaoConfig = daoConfigMap.get(NetServerDao.class).clone();
        netServerDaoConfig.initIdentityScope(type);

        showcaseDaoConfig = daoConfigMap.get(ShowcaseDao.class).clone();
        showcaseDaoConfig.initIdentityScope(type);

        showroomDaoConfig = daoConfigMap.get(ShowroomDao.class).clone();
        showroomDaoConfig.initIdentityScope(type);

        systemSettingDaoConfig = daoConfigMap.get(SystemSettingDao.class).clone();
        systemSettingDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        userTokenDaoConfig = daoConfigMap.get(UserTokenDao.class).clone();
        userTokenDaoConfig.initIdentityScope(type);

        buttonDao = new ButtonDao(buttonDaoConfig, this);
        doorDao = new DoorDao(doorDaoConfig, this);
        doorCommandDao = new DoorCommandDao(doorCommandDaoConfig, this);
        lightDao = new LightDao(lightDaoConfig, this);
        netPatternDao = new NetPatternDao(netPatternDaoConfig, this);
        netServerDao = new NetServerDao(netServerDaoConfig, this);
        showcaseDao = new ShowcaseDao(showcaseDaoConfig, this);
        showroomDao = new ShowroomDao(showroomDaoConfig, this);
        systemSettingDao = new SystemSettingDao(systemSettingDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        userTokenDao = new UserTokenDao(userTokenDaoConfig, this);

        registerDao(Button.class, buttonDao);
        registerDao(Door.class, doorDao);
        registerDao(DoorCommand.class, doorCommandDao);
        registerDao(Light.class, lightDao);
        registerDao(NetPattern.class, netPatternDao);
        registerDao(NetServer.class, netServerDao);
        registerDao(Showcase.class, showcaseDao);
        registerDao(Showroom.class, showroomDao);
        registerDao(SystemSetting.class, systemSettingDao);
        registerDao(User.class, userDao);
        registerDao(UserToken.class, userTokenDao);
    }
    
    public void clear() {
        buttonDaoConfig.clearIdentityScope();
        doorDaoConfig.clearIdentityScope();
        doorCommandDaoConfig.clearIdentityScope();
        lightDaoConfig.clearIdentityScope();
        netPatternDaoConfig.clearIdentityScope();
        netServerDaoConfig.clearIdentityScope();
        showcaseDaoConfig.clearIdentityScope();
        showroomDaoConfig.clearIdentityScope();
        systemSettingDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        userTokenDaoConfig.clearIdentityScope();
    }

    public ButtonDao getButtonDao() {
        return buttonDao;
    }

    public DoorDao getDoorDao() {
        return doorDao;
    }

    public DoorCommandDao getDoorCommandDao() {
        return doorCommandDao;
    }

    public LightDao getLightDao() {
        return lightDao;
    }

    public NetPatternDao getNetPatternDao() {
        return netPatternDao;
    }

    public NetServerDao getNetServerDao() {
        return netServerDao;
    }

    public ShowcaseDao getShowcaseDao() {
        return showcaseDao;
    }

    public ShowroomDao getShowroomDao() {
        return showroomDao;
    }

    public SystemSettingDao getSystemSettingDao() {
        return systemSettingDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public UserTokenDao getUserTokenDao() {
        return userTokenDao;
    }

}
